<!DOCTYPE html>
<html>
  <head>
    <title>用来演示后台如何进行数据库操作</title>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit">
    <link rel="stylesheet" href="../css/bootstrap.min.css" />
    <link rel="stylesheet" href="../css/bootstrap-select.min.css" />
    <link rel="stylesheet" href="../css/toastr.min.css" />
    <link rel="stylesheet" href="../css/main.css" />
    <link rel="stylesheet" href="../css/validationEngine.jquery.css" />
    <script src="../js/jquery.min.js"></script>
    <script src="../js/json.min.js"></script>
    <script src="../js/jquery.i18n.properties-min.js"></script>
    <script src="../js/bootstrap.min.js"></script>
    <script src="../js/bootstrap-select.min.js"></script>
    <script src="../js/bootstrap-datetimepicker.min.js"></script>
    <script src="../js/toastr.min.js"></script>
	<script src="../js/core.js"></script>
    <script src="../js/core-datagrid.js"></script>
    <script src="../js/core-etable.js"></script>
    <script src="../js/jquery.validationEngine.min.js"></script>
    <script src="../js/jquery.validationEngine-zh_CN.js"></script>
  </head>
  <button id="getDemoById" class="btn btn-primary">getDemoById</button>
  <button id="createDemo" class="btn btn-primary">createDemo</button>
  <button id="modifyDemo" class="btn btn-primary">modifyDemo</button>
  
  <button id="returnList" class="btn btn-primary">返回单一的List</button>
  <button id="returnObjAndList" class="btn btn-primary">返回对象和List</button>
  <button id="returnMultipleList" class="btn btn-primary">返回多个List</button>
  
  <textarea id="response" type="text" rows="10" class="form-control"></textarea>
 <script type="text/javascript">
    $(document).ready(function() {
    	 $("#getDemoById").click(function(){
    		 var para = {demoId:"1"};
    		 callSvr("demo/getDemoById", para, function(result) {
    			 $("#response").val(JSON.stringify(result));
    			 toastr.success('调用成功', '');
             });
    		 
    	 });
    	 
    	 $("#createDemo").click(function(){
    		 var para = {demoId:"",DemoString:"createDemo",DemoFloat:"0",DemoInt:"123",DemoLong:"123123"};
    		 callSvr("demo/createDemo", para, function(result) {
    			 $("#response").val(JSON.stringify(result));
    			 toastr.success('调用成功', '');
             });
    	 });
    	 
    	 $("#modifyDemo").click(function(){
    		 var para = {demoId:"1",DemoString:"modifyDemo",DemoFloat:"0",DemoInt:"123",DemoLong:"123123"};
    		 callSvr("demo/modifyDemo", para, function(result) {
    			 $("#response").val(JSON.stringify(result));
    			 toastr.success('调用成功', '');
             });
    	 });
    	 
    	 $("#returnList").click(function(){
    		 callSvr("demo/returnList", {}, function(result) {
    			 $("#response").val(JSON.stringify(result));
    			 toastr.success('调用成功', '');
             });
    	 });
    	 $("#returnObjAndList").click(function(){
    		 callSvr("demo/returnObjAndList", {}, function(result) {
    			 $("#response").val(JSON.stringify(result));
    			 toastr.success('调用成功', '');
             });
    	 });
    	 $("#returnMultipleList").click(function(){
    		 callSvr("demo/returnMultipleList", {}, function(result) {
    			 $("#response").val(JSON.stringify(result));
    			 toastr.success('调用成功', '');
             });
    	 });
    	 
    });
 </script>
  
</html>